import React from 'react';
import styles from './index.module.scss';
import { Breadcrumb, Button } from '@alifd/next';
import CustomIcon from '@/components/CustomIcon';
import { formlizeTitle } from '@/utils/formlize.js';


const WrapperPage = ({children, path, back, history} ) => {
  return (
    <>
      <div className={styles.title}>
        {  back && 
            <span className={styles['title-back']}>
              <Button className="round-button" type="primary" onClick={()=>{history.goBack()}}>
                  <CustomIcon type="iconrollback"/>
              </Button>
            </span>
        }
        <span className={styles['title-word']}>{formlizeTitle(path)}</span>
      </div>
      <div className={styles.content}>
       {children}
      </div>
    </>
  );
}

export default WrapperPage;